
package com.jf.cloud.combo.feign;

import com.jf.cloud.api.combo.feign.ComboSpuFeignClient;
import com.jf.cloud.combo.service.ComboSpuService;
import com.jf.cloud.common.product.vo.ComboSpuVO;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Hidden;

import java.util.List;

/**
 * @author zz
 * @date 2022/9/28 9:49
 */
@RestController
@Hidden
public class ComboSpuFeignController implements ComboSpuFeignClient {
    @Autowired
    private ComboSpuService comboSpuService;

    @Override
    public ServerResponseEntity<List<ComboSpuVO>> comboSpuByComboId(Long comboId) {
        List<ComboSpuVO> matchSpuByComboId = comboSpuService.comboSpuByComboId(comboId);
        return ServerResponseEntity.success(matchSpuByComboId);
    }

    @Override
    public ServerResponseEntity<Void> comboSpuOfflineDispose(List<Long> spuIdList) {
        comboSpuService.comboSpuOfflineDispose(spuIdList);
        return ServerResponseEntity.success();
    }
}
